<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8"); 

	String I_PERNR = request.getParameter("I_PERNR");
	String E_ENAME = request.getParameter("E_ENAME");
	String E_YEAR = request.getParameter("E_YEAR");
	String E_BIRDT = request.getParameter("E_BIRDT");
	String E_WORKPLACE = request.getParameter("E_WORKPLACE");
	String E_BIZNO = request.getParameter("E_BIZNO");
	String E_REGNO = request.getParameter("E_REGNO");
	String E_BIZPLACE = request.getParameter("E_BIZPLACE");
	String E_ADDRESS = request.getParameter("E_ADDRESS");
	String E_SYS_YEAR = request.getParameter("E_SYS_YEAR");
	String E_SYS_MONTH = request.getParameter("E_SYS_MONTH");
	String E_SYS_DAY = request.getParameter("E_SYS_DAY");
	
	String E_10 = request.getParameter("E_10");
	String E_20 = request.getParameter("E_20");
	String E_21 = request.getParameter("E_21");
	String E_30 = request.getParameter("E_30");
	String E_31 = request.getParameter("E_31");
	String E_40 = request.getParameter("E_40");
	String E_41 = request.getParameter("E_41");
	String E_42 = request.getParameter("E_42");
	String E_50 = request.getParameter("E_50");
	String E_M1 = request.getParameter("E_M1");
	String E_M2 = request.getParameter("E_M2");
	
	final int MAX_COUNT = 14;
	String M_COUNT = request.getParameter("M_COUNT") == null ? "0" : request.getParameter("M_COUNT");
	int count = Integer.parseInt(M_COUNT);
	//if(count > MAX_COUNT)	count = MAX_COUNT;
	
	String [] REGNO = new String[count];
	String [] DEPTY = new String[count];	
	String [] BIZNO = new String[count];		
	String [] MEDNO = new String[count];		
	String [] COUNT = new String[count];		
	String [] AMOUNT = new String[count];	
	
	String [] SUPNM = new String[count];
	
	
	
	for(int i=0; i<count; ++i) {
		REGNO[i] = request.getParameter("REGNO" + Integer.toString(i)) == null ? "" : request.getParameter("REGNO" + Integer.toString(i));
		DEPTY[i] = request.getParameter("DEPTY" + Integer.toString(i)) == null ? "" : request.getParameter("DEPTY" + Integer.toString(i));	
		BIZNO[i] = request.getParameter("BIZNO" + Integer.toString(i)) == null ? "" : request.getParameter("BIZNO" + Integer.toString(i));	
		MEDNO[i] = request.getParameter("MEDNO" + Integer.toString(i)) == null ? "" : request.getParameter("MEDNO" + Integer.toString(i));	
		COUNT[i] = request.getParameter("COUNT" + Integer.toString(i)) == null ? "" : request.getParameter("COUNT" + Integer.toString(i));	
		AMOUNT[i] = request.getParameter("AMOUNT" + Integer.toString(i)) == null ? "" : request.getParameter("AMOUNT" + Integer.toString(i));	
		
		SUPNM[i] = request.getParameter("SUPNM" + Integer.toString(i)) == null ? "" : request.getParameter("SUPNM" + Integer.toString(i));
	}
	
%>
    
<html>
<head>
<title>
의료비 지급 명세서
</title> 


<style>
	td{font-size:11px;}
	.td_t1{
		font-size:18px;
		font-weight:bold;
	}
	.td_t2{
		font-size:14px;
		font-weight:bold;
	}

</style>


<script language="javascript">

  function Print(){
   document.all.ptLayer.style.display="none";
   self.print();
   document.all.ptLayer.style.display="block";
  }

</script>
</head>

<body  topmargin="0" marginwidth="0" marginheight="0" align="center">
<FORM name="webguiform" method=post >
         
         
<!-- HEAER print -->
<table width="710" border="0" cellspacing="0" cellpadding="0" height="10">
  <tr> 
  	<td width="510" align="left">&nbsp;■ 소득세법 시행규칙 [별지 제43호 서식]</td>
    <td width="200" height="20" align="right" valign="bottom" class="td_f3" > 
      <table width="100%" border="1" cellspacing="0" cellpadding="0"  bordercolor="000000" style="border-collapse:collapse;border-width:0.5px;">
        <tr align="center"> 
          <td width="50%" height="20" style="border-bottom-width:0;">사번</td>
          <td width="50%" height="20" style="border-bottom-width:0;"><%= I_PERNR%></td>
        </tr>
      </table></td>
  </tr>
</table> 



<!--    의료비비급명세서 시작 (의료비지급명세서 년도 의료비지급내역까지) 시작     -->
<table width="710" cellspacing="0" cellpadding="0" border="1"  bordercolor="000000" style="border-collapse:collapse;border-width:1px;">
  <tr>  
    <td colspan="4" class="td_t1" height="45" align="center"> 의료비지급명세서</td>
  </tr>
  <tr> 
    <td height="41" colspan="4" align="center" class="td_t2">소득자 인적사항</td>
  </tr>
  <tr> 
    <td width="25%" height="30" align="center"  >①성명</td>
    <td width="25%" align="center" ><%= E_ENAME%></td>
    <td width="25%" align="center" >②주민등록번호<br>(외국인확인번호)</td>
    <td width="25%" align="center" ><%= E_REGNO%></td>
  </tr>
  <tr> 
    <td  height="30"  align="center" >③상호</td>
    <td  align="center" ><%= E_WORKPLACE%></td>
    <td  align="center" >④사업자등록번호</td>
    <td  align="center" ><%= E_BIZNO%></td>
  </tr>

  <tr> 
    <td height="31" colspan="4" align="center" class="td_t2"><b>(<%= E_YEAR%>)년도 의료비 지급명세서</b> </td>
  </tr>
</table>
<!--      의료비비급명세 서 시작 (의 료비지급명세서 년도 의료비지급내역까지) 끝      -->
<!--     지금처 지금내역 대상자 비고 테이블 시작    -->
<table width="710" border="1" cellspacing="0" cellpadding="0"  frame="vsides"  bordercolor="000000" style="border-collapse:collapse;border-width:1px;
 ">
  <tr align="center"> 
    <td colspan="2" >의료비 공제 대상자</td>
    <td height="25" colspan="3" >지급처</td>
    <td colspan="2" >지급명세</td>

  </tr>
  <tr> 
    <td width="120" height="40" align="center">⑤주민등록번호</td>
    <td width="60" align="center">⑥본인등 해당여부</td>
    <td width="140"  align="center">⑦사업자등록번호</td>
    
    <td  align="center">⑧상호</td>
    
    <td width="60"  align="center">⑨의료증빙코드</td>
    <td width="40" height="20" align="center">⑩건수</td>
    <td width="120" align="center">⑪금액</td>
  </tr>
  <tr> 
  </tr>


<!--  본문 테이블 Content-->
      

<!-- j가 총data건수보다 크면 빈 라인을 찍는다 -->
 <% 
	for(int i=0; i<count; ++i) {
%>
            <tr align="center" > 
               <td height="30" class="td_c" align="center"><%= REGNO[i]%></td>
               <td height="30" class="td_c" align="center"><%= DEPTY[i]%></td>
               <td height="30" class="td_c" align="center"><%= BIZNO[i]%></td>
               
               <td height="30" class="td_c" align="center"><%= SUPNM[i]%></td>
               
               <td height="30" class="td_c" align="center"><%= MEDNO[i]%></td>
               <td height="30" class="td_c" align="center"><%= COUNT[i]%></td>
               <td height="30" class="td_c" align="right" style="padding-right:5;"><%= AMOUNT[i]%></td>
            </tr>
<% 
	}
	for(int j = 0; j < MAX_COUNT-count; ++j ) { 
%>
<!-- j가 총data건수보다 크면 빈 라인을 찍는다 -->
         
            <tr align="center" > 
               <td height="30" class="td_c" align="center"> &nbsp;</td>
               <td height="30" class="td_c" align="center">&nbsp;</td>
               <td height="30" class="td_c" align="center">&nbsp;</td>
               <td height="30" class="td_c" align="center">&nbsp;</td>
               <td height="30" class="td_c" align="center">&nbsp;</td>
               <td height="30" class="td_c" align="center">&nbsp;</td>
               <td height="30" class="td_c" align="right" style="padding-right:5;">&nbsp;</td>
            </tr>
<% 
	}
%>

<!-- 합계 -->
           
         <tr align="center"> 
             <td height="30" colspan="2" bgcolor="#999999">&nbsp;</td>
             <td height="30" colspan="3" align="center">합계</td>
             <td height="30" class="td_c" align="center"> &nbsp;<%=E_M1 %> </td> <!--건수 --> 
             <td height="30" class="td_c" align="right" style="padding-right:5;">&nbsp;<%= E_M2%></td>  <!--금액 -->
           </tr>

          


<!-- FOOTER -->
<table width="710" border="1" cellspacing="0" cellpadding="0" bordercolor="000000" style="border-collapse:collapse;border-width:1px;
 ">
   
  <tr> 
    <td colspan="2" height="150"> <table width="710" border="0" cellspacing="0" cellpadding="2">
        <tr> 
          <td  colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;「소득세법」 제52조 및 「소득세법 시행령」 제110조 제3항과 제113조 제1항에 따라 의료비를 공제받고자<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;의료비지급명세서를 제출합니다.</td>
        </tr>
        <tr> 
          <td height="30" colspan="2" align="center" valign="bottom" >
             <table width="300" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="td_t_2" align="center" ><%= E_SYS_YEAR%>년&nbsp;&nbsp;&nbsp; <%= E_SYS_MONTH%>월&nbsp;&nbsp;&nbsp; <%= E_SYS_DAY%>일</td> 
              </tr>
            </table></td>
        </tr> 
      <tr> 
          <td height="30" colspan="2" align="center" valign="bottom" >
             <table width="300" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="center" >제출자&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%= E_ENAME%>&nbsp;&nbsp;&nbsp;(서명 또는 날인)</td> 
              </tr>
            </table></td>
        </tr>
 
        <tr> 
          <td width="322"><table width="200" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td align="right"  >귀하</td>
              </tr>
            </table></td>
          <td width="292">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  
 <!------------ start 2007.12.06 choijj comment by kimjy 
  <tr> 
    <td colspan="2" class="td_s1_1" height="170">`#TT29`<br>`#TT30`<br>`#TT31` <br>`#TT32`
      <br> `#TT33`</td>
  </tr>
  <tr> 
    <td width="59" height="50" align="center"class="td_s2_1" > `#TT34` </td>
    <td width="615" height="55"class="td_s21" align="justify"> `#TT35`<br> `#TT36` </td>
  </tr>
                 end  2007.12.06 choijj comment by kimjy ------------------------------>
 <!------------ start 2007.12.06 choijj add by kimjy 
                20090106 CHOIJJ MODIFY BY KIMBJ ----------------------------------> 


<!--------------------- 20090112 choijj comment for add data line by kimbj 
  <tr> 
    <td colspan="2" class="td_t_2" height="35" align="justify"><p>`#TTD68`</p>
      <ol>
        <li>`#TTD69`</li>
        <li>`#TTD70`</li>
            `#TTD71`<br>
        <li>`#TTD72`</li>
        <li>`#TTD73`</li>
       <li> `#TTD74`</li>
      `#TTD75`<br>
      `#TTD76`<br>
      `#TTD77`<br>
      `#TTD78`<br>
      `#TTD781`<br>
      `#TTD782`<br>
      `#TTD783`<br>
      `#TTD784`<br>
       <li> `#TTD785`</li>
      </ol>
     <br> 
    </td>
  </tr>
 --------------------------------------------------------------------------->
 <tr> 
    <td colspan="2" class="td_t_2" height="45" align="justify">※ 구비서류 :　작성방법 5번란의 증빙자료 (  )매 (의료비 지급내역 순서와 일치되도록 편철합니다.)</td>
  </tr>

 <!------------  end  2007.12.06 choijj add by kimjy ---------------------------------->
</table>

  

<br/>

<!-- 버튼 이 미지 시작-->
     <div id="ptLayer">
      <table width="100%" border="0" cellspacing="1" cellpadding="1">
        <!-- `Title_Bottom_Blank()` -->
        <tr> 
          <td><div align="center">
               <button onclick="Print()">명세서출력</button>
          </td>
        </tr>
        <!-- `Title_Bottom_Blank()` -->
      </table>
     </div>
      <!-- 버 튼 이미지 끝-->

  </form>
</body>
</html>
